package com.ibeeking.found.upms.api.feign;

import com.ibeeking.found.upms.api.common.dto.EmployeeDTO;
import com.ibeeking.found.upms.api.common.param.EmployeeParam;
import com.ibeeking.found.upms.api.common.query.EmployeeQuery;
import com.ibeeking.found.upms.api.feign.fallback.OrgEmployeeCpFallbackFactory;
import com.ibeeking.nematos.utils.result.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Author ibeeking
 */
@FeignClient(name = "base-org-cp-server", path = "/cp", contextId = "orgEmployeeCpFeignClient", fallbackFactory = OrgEmployeeCpFallbackFactory.class, decode404 = true)
public interface OrgEmployeeCpFeignClient {

    /**
     * 查询所有员工
     * @param query
     * @return
     */
    @PostMapping(value = "/employee/feign/v1/queryEmployeeList")
    ResponseResult<List<EmployeeDTO>> queryEmployeeList(@RequestBody EmployeeQuery query);

    /**
     * 查询所有员工
     * @param param
     * @return
     */
    @PostMapping(value = "/employee/feign/v1/addAndUpdteEmployee")
    ResponseResult<Boolean> addAndUpdteEmployee(@RequestBody EmployeeParam param);
}
